﻿using System.Web.Mvc;
using CSF.Utility.Mvc;
using System.Web.Routing;

namespace CSF.WebApp.Admin.Areas.Common
{
    public class CommonAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Common";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            SecureRoute route = new SecureRoute(
                "Common/{controller}/{action}/{id}",
                new RouteValueDictionary(new { controller = "Region", action = "Index", id = UrlParameter.Optional }),
                new MvcRouteHandler(), context.AreaName);
            context.Routes.Add("Common_default", route);

            //context.MapRoute(
            //    "Common_default",
            //    "Common/{controller}/{action}/{id}",
            //    new { action = "Index", id = UrlParameter.Optional }
            //);
        }
    }
}
